package com.anxin.registerManagement.bean.persist;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

@Data
@ApiModel("角色类")
public class Role {

    @TableId(type = IdType.AUTO)
    @ApiModelProperty("角色id")
    private Integer id;

    @NotBlank(message = "角色名称不能为空")
    @ApiModelProperty("角色名称")
    private String roleName;

    @NotBlank(message = "角色标识不能为空")
    @Pattern(regexp = "^[A-Za-z]+$", message = "角色标识只能由字母组成")
    @ApiModelProperty("角色标识")
    private String roleCode;

    @ApiModelProperty("角色描述")
    private String roleDesc;
}
